package cn.edu.hatu.bookshop.dao;

import cn.edu.hatu.bookshop.entity.Classify;
import cn.edu.hatu.bookshop.entity.type;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface ClassifyMapper {

    @Select("select * from classify")
    List<Classify> getAll();
    @Select("select count(*) from classify")
    int getTableCount();
    @Select("select classifyName from classify where classifyId = #{classifyId}")
    String getClassifyName(@Param("classifyId")int classifyId);
    @Select("select classifyId from classify where classifyName = #{classifyName}")
    int getClassifyId(@Param("classifyName")String classifyName);

}
